﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using CSP.Model.CSP;

namespace CSP.DataAccess.Mapping
{
    public class OrderRemindMap : EntityTypeConfiguration<OrderRemind>
    {
        public OrderRemindMap()
        {
            // Primary Key
            this.HasKey(t => t.OrderNumber);

            // Properties
            this.Property(t => t.OrderNumber)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("OrderRemind");
            this.Property(t => t.OrderNumber).HasColumnName("OrderNumber");
            this.Property(t => t.RemindStatus).HasColumnName("RemindStatus");
            this.Property(t => t.LostTime).HasColumnName("LostTime");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");

            // Relationships
            this.HasRequired(t => t.Order)
                .WithOptional(t => t.OrderRemind);

        }
    }
}
